<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@include file="../tag/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单查询</title>
<script type="text/javascript" src="../../js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../../js/flexigrid/flexigrid.js"></script>
<script type="text/javascript"
	src="../../js/flexigrid/flexigrid.pack.js"></script>
<link type="text/css" href="../../css/flexigrid/flexigrid.css"
	rel="stylesheet" />
<link type="text/css" href="../../css/flexigrid/flexigrid.pack.css"
	rel="stylesheet" />
</head>
<body>
<hr>
<br>
<div align="center">
<form action="" method="post">
<table width="100%" border="1" cellpadding="0"
	cellspacing="0">
	<span style="color: white;">查询条件sss</span>

</table>
</form>
</div>
<div align="center">
<table id="flexme2" width="100%" border="1" cellpadding="0"
	cellspacing="0">
	<thead>
		<tr>
			<th>编号</th>
			<th>客户</th>
			<th>订单时间</th>
			<th>end时间</th>
			<th>状态</th>
			<th>是否签字</th>
			<th>带单人</th>
			<th>备注信息</th>
		</tr>
	</thead>
	<tbody>
		<tr>
		<td>sdf</td>
		<td>gsd</td>
		<td>wef</td>
		<td>sdg</td>
		<td>sdg</td>
		<td>dsg</td>
		<td>sg</td>
		<td>ff</td>
		</tr>
	</tbody>
</table>
<table id="flex1" style="display:none"></table> 
</div>
</body>
<script type="text/javascript">
	$(function() {
		$.ajax({
			   type: "POST",
			   url: "http://localhost:8080/xst11/order!getOrderList",
			   dataType: "json",
			   success: function(data){
			     alert(data);
			   }
		});
		//$('#flexme2').flexigrid({height:'auto',striped:false});
		$("#flex1").flexigrid({
			url: 'http://localhost:8080/xst11/order!getOrderList',
			dataType: 'json',
			colModel : [
				{display: '编号', name : 'dresultList[0].id', width : 40, sortable : true, align: 'center'},
				{display: '客户', name : 'customer', width : 100, sortable : true, align: 'left'},
				{display: '订单时间', name : 'startDate', width : 100, sortable : true, align: 'left'},
				{display: 'end时间', name : 'endDate', width : 100, sortable : true, align: 'left'},
				{display: '状态', name : 'status', width : 70, sortable : true, align: 'left'},
				{display: '是否签字', name : 'isSign', width : 70, sortable : true, align: 'left'},
				{display: '带单人', name : 'takeName', width : 50, sortable : true, align: 'left'},
				{display: '备注信息', name : 'remark', width : 120, sortable : true, align: 'right'}
				],
			buttons : [
				{name: '添加', bclass: 'add', onpress : doCommand},
				{name: '删除', bclass: 'delete', onpress : doCommand},
				{separator: true}
				],
			searchitems : [
				{display: '编号', name : 'id'},
				{display: '客户', name : 'customer', isdefault: true}
				],
			sortname: "id",
			sortorder: "asc",
			usepager: true,
			title: '订单清单',
			nomsg: '没找到任何结果',//无结果的提示信息
			useRp: true,
			rp: 15,
			showTableToggleBtn: true,
			width: 700,
			procmsg: '数据加载中, 请稍等 ...',
			height: 200
		});   
	});
	function doCommand(com, grid) {
		if (com == 'Edit') {
		$('.trSelected', grid).each(function() {
		var id = $(this).attr('id');
		id = id.substring(id.lastIndexOf('row')+3);
		alert("Edit row " + id);
		});
		} else if (com == 'Delete') {
		$('.trSelected', grid).each(function() {
		var id = $(this).attr('id');
		id = id.substring(id.lastIndexOf('row')+3);
		alert("Delete row " + id);
		});
		}
		}
</script>
</html>